<div>
<h1>查找替换</h1>
<pre>
<span id="/pattern">/pattern</span>            <span>从光标处向文件尾搜索 pattern</span>
<span id="?pattern">?pattern</span>            <span>从光标处向文件头搜索 pattern</span>
<span id="n">n</span>                   <span>向同一方向执行上一次搜索</span>
<span id="N">N</span>                   <span>向相反方向执行上一次搜索</span>
<span id="*">*</span>                   <span>向前搜索光标下的单词</span>
<span id="#">#</span>                   <span>向后搜索光标下的单词</span>
<span id=":s/p1/p2/g">:s/p1/p2/g</span>          <span>将当前行中全替换p1为p2</span>
<span id=":%s/p1/p2/g">:%s/p1/p2/g</span>         <span>将当前文件中全替换p1为p2</span>
<span id=":%s/p1/p2/gc">:%s/p1/p2/gc</span>        <span>将当前文件中全替换p1为p2，并且每处询问你是否替换</span>
<span id=":10,20s/p1/p2/g">:10,20s/p1/p2/g</span>     <span>将第10到20行中所有p1替换为p2</span>
<span id=":%s/1\\2\/3/123/g">:%s/1\\2\/3/123/g</span>   <span>将“1\2/3” 替换为 “123”（特殊字符使用反斜杠标注）</span>
<span id=":%s/\r//g">:%s/\r//g</span>           <span>删除 DOS 换行符 ^M</span>
</pre>
</div>